/**
 * copyright(c) 2013 www.jiongshibaoliao.com, All Rights Reserved.
 * project: jiongshibaoliao 
 * author: 曾帅
 * date: 2014-2-17 上午11:15:25
 * version: v1.0
 */

package com.jiongshibaoliao.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

/**
 * @project jiongshibaoliao
 * @author 曾帅
 * @version 1.0
 * @date 2014-2-17 上午11:15:25
 */

public class UserInterceptor implements HandlerInterceptor {
	
	private Logger logger = Logger.getLogger(UserInterceptor.class);

	@Override
	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception e) throws Exception {
		 logger.info("==============执行顺序3================");
	}

	@Override
	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView mv) throws Exception {
		logger.info("==============执行顺序2================");
	}

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
		logger.info("*****************************spring interceptor start*****************************");
		String url = request.getRequestURL().toString();
		logger.info("==============执行顺序1================url:" + url);
		return true;
	}
}
